Skip to content

fix(aggregator/projects): deduplicate overlapping-page items so the Project #4 audit survives its gate (#8599) - #8655

Merged
dezren39 merged 1 commit into
mainfrom
queue/14916-8599-audit-dedupe
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/14916-8599-audit-dedupe

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Fixes #8599.

Problem

fetchProjectSnapshot tolerated overlapping pages (shortfall-only completeness check) but built the Project #4 audit from the raw, un-deduplicated nodes: each distribution summed to the delivered node count, so an over-delivered export produced distributions summing to more than totalItems, the feed-side isProjectAudit gate rejected it, and a successfully fetched snapshot surfaced as "absent" with watchdog remediation pointing at the collector/token.

Fix (acceptance option 1)

  • pm-stack/aggregator/src/projects.ts: deduplicate by item id at collection in fetchProjectSnapshot (first delivery wins) for both the audit items and the parsed pool; completeness is judged on the deduplicated count. The choice is stated in a comment where fetch tolerance meets the feed gate: both sides now agree on the distinct-item count.
  • Regression test: a two-page export where page 2 repeats a node from page 1 — the audit sums to totalItems, survives isProjectAudit, and the pool contains each item once.
  • Also corrected a pre-existing stale expectation in the same test file (dezren39/nix -> dezren39/darwin-nix, matching the fixture; verified failing on clean main before this change).

Verification

  • bun test test/projects.test.ts — 19 pass (was 17 pass / 1 pre-existing fail on clean main).
  • bun test test/feed.test.ts test/watchdog.test.ts — 90 pass.
  • tsc --noEmit — same single pre-existing error with and without this change; none in projects.ts.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 11:26
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c426c9e6-2618-46ff-8f0d-3f430c14b798
Commits

Reviewing files that changed from the base of the PR and between 83b7cdc and 03faeef.

Files selected for processing: 2

  • pm-stack/aggregator/src/projects.ts
  • pm-stack/aggregator/test/projects.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T11:28:02.157332Z 03faeef PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant